Update GitHub Actions workflow to push tags to origin #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: [push, pull_request_target] | |
| name: Test and lint | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@master | |
| - run: npm test | |
| package_check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@master | |
| - name: "Ensure that code has been packaged and commited" | |
| run: |- | |
| npm install | |
| npm run package | |
| git diff --exit-code dist/index.js || \ | |
| (echo -e "\nPlease run 'npm run package' and commit the results" && exit 1) | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ ubuntu-latest, macos-latest, windows-latest ] | |
| steps: | |
| - uses: actions/checkout@master | |
| - name: Install deck with token and team id | |
| uses: ./ | |
| with: | |
| token: ${{ secrets.DECKRUN_API_TOKEN }} | |
| team_id: ${{ secrets.DECKRUN_TEAM_ID }} | |
| - name: Install deck with token and no team id | |
| uses: ./ | |
| with: | |
| token: ${{ secrets.DECKRUN_API_TOKEN }} | |
| - name: Verify installation | |
| run: deck version | |
| - name: Verify log-in | |
| run: deck auth check | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: [lint, package_check, test] | |
| permissions: | |
| contents: write | |
| actions: write | |
| steps: | |
| - uses: actions/checkout@master | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| if: github.ref_type == 'tag' | |
| with: | |
| generate_release_notes: true | |
| - name: Update v1.0 tag | |
| if: github.ref_type == 'tag' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git tag -f v1.0 ${{ github.ref_name }} | |
| git push origin v1.0 --force |